﻿@using Emoney.UserTraining.Model;
@using Emoney.UserTraining.Comm;
@{
    ViewBag.Title = "dmtrain";
    Layout = "~/Views/Shared/_TrainLayout.cshtml";
}
@{
    var lst = (List<DmTrain>)ViewData["dmlist"];
    var lstT = (List<DmTrain>)ViewData["targetlst"];
    var tid = ViewData["trainid"].ToString();
    var uid = ViewBag.uid;
}
<link href="@StringTools.GetStaticFile("css/Train/scroll.css")" rel="stylesheet" />
<script src="@StringTools.GetStaticFile("js/JYMScroll.js")"></script>
<script src="@StringTools.GetStaticFile("js/comTrain.js")"></script>
<div id="menuflag" style="display:none">2</div> <!--菜单切换效果使用-->
	<div class="content">
                @if(lstT.Count>0)
                {
		<div class="left">
			<div class="tranLabel">
                <div class="scroll-pane" style="height:372px;" id="jscroll-pane" scrollflag>
                    <div id="vCnt">
                @*<div class="scrollbar"><div class="handle"></div></div>*@
                @{
                int i=0;
                foreach(var c in lstT)
                {
                    var tname = c.place_name;
                    if(tname.Length>15)
                    {
                        tname = tname.Substring(0, 15);
                    }
                    var ttime = c.train_time;
                    if(ttime.Length>10)
                    {
                        ttime = ttime.Substring(0, 10);
                    }
                    var url = Url.Content("~/Train/dmtrain?uid="+uid);
                    
                    if(url.IndexOf("trainid")>0)
                    {
                        url = StringTools.ChagePara(url, "trainid", c.id);
                    }
                    else
                    {
                        url = url + "&trainid=" + c.id;
                    }
                    if(tid!="")
                    {
                        if(tid==c.id)
                        {
                            <a href="@url" style="text-decoration:none"><div class="item itemcur">
					            <div class="head"><img style="width:39px;height:39px;"  src="@StringTools.GetTeacherImg(c.teacherimg,39)" /></div>
					            <div class="brief"><span class="t3">@tname</span><br /><span class="t1">讲师：@c.teachername&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
				            </div></a>
                        }
                        else
                        {
                            <a href="@url" style="text-decoration:none"><div class="item">
					            <div class="head"><img style="width:39px;height:39px;"  src="@StringTools.GetTeacherImg(c.teacherimg,39)" /></div>
					            <div class="brief"><span class="t1">@tname</span><br /><span class="t2">讲师：@c.teachername&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
				            </div></a>
                        }
                        }
                    else
                    {
                        if (i == 0)
                        {
                           <a href="@url" style="text-decoration:none"><div class="item itemcur">
					            <div class="head"><img style="width:39px;height:39px;"  src="@StringTools.GetTeacherImg(c.teacherimg,39)" /></div>
					            <div class="brief"><span class="t3">@tname</span><br /><span class="t1">讲师：@c.teachername&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
				            </div></a>
                        }
                        else
                        {
                            <a href="@url" style="text-decoration:none"><div class="item">
					            <div class="head"><img style="width:39px;height:39px;" src="@StringTools.GetTeacherImg(c.teacherimg,39)" /></div>
					            <div class="brief"><span class="t1">@tname</span><br /><span class="t2">讲师：@c.teachername&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
				            </div></a>
                        }
                    }
                    i++;
                }
                }
                        </div>
                    </div>
                <script>
                    //设定滚动条
                    //创建滚动条
                    //参数：滚动区域的对象（jquery对象）
                    function CreatWinScrollStyle1(obj) {
                        obj.jscroll({
                            W: "7px"
                       , IW: "7px"
                       , CurrT: 0
                       , Bar: { Pos: "up" }
                       , Btn: { btn: false }
                       , Fn: function () { }
                        });
                    };
                    //改变滚动区域大小后调整滚动条

                    function setHTMContent(vxTit, vxTim, vxCnt) {
                        ReSetScroll(window);
                        $(".jscroll-c").css({ "top": "0px" });
                    }
                    $(function () {
                        //CreatWinScrollStyle1($("#jscroll-pane"));
                        CreatWinScrollStyle1($("#jscroll-pane"));
                    }); </script>
			</div>
            <div class="serv" style="text-align:left;">
    <a href="http://b.qq.com/webc.htm?new=0&sid=4006708688&eid=218808P8z8p8P8K8R8K8p&o=&q=7&from=qqwpa" target="_blank">
        <img src="@StringTools.GetStaticFile("Images/Train/images/btn_qqservice.jpg")" alt="益盟客服" /></a>&nbsp;
    全国服务热线：400-670-8688
    </div>
		</div>
		<div class="right">
			<div class="detail">
				<div class="cont" style="overflow:auto; overflow-x:hidden; ">
                    @if (lst.Count > 0)
                    {
                        foreach (var c in lst)
                        {
                            var strtrain_intro = c.train_intro;
                            <div id="placeid" style="display:none">@c.id</div>
                            <div style="display:none" id="paddr">@c.train_addr</div>
                            <div style="display:none" id="placenum">@c.place_num</div>
                            <span style="display:none" id="spanarea">@ViewData["area"].ToString()</span>
					    <table width="95%" cellpadding="0" cellspacing="5" >
						    <tr>
							    <td width="35"><span class="bt">主题</span></td>
							    <td class="fs14 fw" id="pname">@c.place_name</td>
						    </tr>
						    <tr>
							    <td></td>
							    <td class="gray"><div>@Html.Raw(c.train_intro)</div></td>
						    </tr>
						    <tr>
							    <td><span class="bt">时间</span></td>
							    <td><b>@c.train_time</b></td>
						    </tr>
                            
						    @*<tr>
							    <td><span class="bt">地点</span></td>
							    <td>@c.train_addr</td>
						    </tr>*@
                            <tr>
							    <td><span class="bt">风格</span></td>
							    <td>@c.train_style</td>
						    </tr>
						    <tr>
							    <td><span class="bt">讲师</span></td>
							    <td><b>@c.teachername</b></td>
						    </tr>
						    <tr>
							    <td></td>
							    <td class="gray">@Html.Raw(c.teacherintro)</td>
						    </tr>
					    </table>
                        <input type="hidden" name="hidno" value="0" />
                        }
                    }
                    else
                    {
                        <input type="hidden" name="hidno" value="1" />
                        <table width="95%" cellpadding="0" cellspacing="5" >
                            <tr><td valign="top">
                            暂时没有需要预约的培训<br />
                            您可以通过<a href="http://v.emoney.cn/xyvideo/index" target="_blank"><span class="cred">学院直播视频</span></a> 进行自助学习<br />
                            也可以选择参加“<a href="@Url.Content("~/Train/wltrain?uid="+uid)"><span class="cred">网络会场培训</span></a>”
                            </td></tr></table>
                    }
				</div>
				<div class="book" id="divisshow">
					<div class="xw">剩余席位
                        @if (lst.Count > 0)
                        {
                            var allnum = int.Parse(lst[0].allnum.ToString());
                            var num = int.Parse(lst[0].num.ToString());
                            var synum = allnum - num;
                            if (synum < 0)
                            {
                                synum = 0;
                            }<span class="fig">@synum</span>
                            if (allnum == -1)
                            { <input type="hidden" id="hidallnum" value="-1" />
                            }
                        }
                        else
                        { 
                            <span class="fig">0</span>
                        }
					</div>
					<div class="yd" id="divissubmit">
                        <input name="Text1" type="text" id="txt_mobile" maxlength="11" value="请输入手机号码以获得预约号" onblur="if{this.value==''}{this.value='请输入手机号码以获得预约号';}" onclick="if (this.value == '请输入手机号码以获得预约号') { this.value = '';}" />
                        <a href="#" id="btnJoin"><img src="@StringTools.GetStaticFile("Images/Train/images/btn_book.jpg")" alt="免费预约" state="true"/></a>
					</div>
				</div>
			</div>
            <div class="serv" style="text-align:right;">
                <a href="http://www.emoney.cn/mini2/mini/2013幸福中国投资宝典.rar" id="btndownfile"><span style="color:red; font-weight:600; text-decoration:underline">《2013幸福中国投资宝典第一期》下载</span></a>
            </div>
		</div>
        }
        else{
        <div class="notrain1">
			<div class="face"><img src="@StringTools.GetStaticFile("Images/Train/images/bg_face1.jpg")" alt="" /></div>
			<span class="fs14 fw">暂时没有预约的培训课程！</span><br />
			您可以通过<a href="http://v.emoney.cn/xyvideo/index" target="_blank" class="b" style="text-decoration:none;">“学院直播视频”</a>进行自助学习，也可以选择参加<a href="@Url.Content("~/Train/wltrain?uid="+uid)" class="b" style="text-decoration:none;">“网络会议培训”</a>
		</div>
            @Html.Partial("dbqq")
        }
	</div>
<!-- 预约成功 start -->
<div class="win" id="OrderSucDiv_dm" style="width:379px;display:none; height:201px;">
	<div class="close"><a href="#" onclick="closetips()"><img src="@StringTools.GetStaticFile("Images/Train/images/btn_close.jpg")" /></a></div>
	@*<div class="top" style="width:378px;">
		<div class="c1"><img src="@StringTools.GetStaticFile("Images/Train/images/win_cor1.gif")" /></div>
		<div class="c2a"></div>
		<div class="c3"><img src="@StringTools.GetStaticFile("Images/Train/images/win_cor2.gif")" /></div>
	</div>*@
	<div class="cont" style="width:378px;">
		<div class="title">预约成功</div>
		<div class="arrow"><img src="@StringTools.GetStaticFile("Images/Train/images/img_arrow.jpg")" /></div>
		<div class="text" style="height:90px; padding-right:20px;">恭喜您！您已成功预约《<span id="spanPname"></span>》课程，您的预约码为	：<span class="haoma" id="spanyyCode">A002</span><br />培训地址：<span id="spanAddr"></span></div>
		<div class="btn" style="padding-left:100px;"><a href="#" onclick="closetips()"><img src="@StringTools.GetStaticFile("Images/Train/images/btn9.jpg")" alt="确定" /></a></div>
		<div class="tip">预约码和培训地址将发送至您的手机，请注意查收</div>
	</div>
	@*<div class="bottom" style="width:378px;">
		<div class="c1"><img src="@StringTools.GetStaticFile("Images/Train/images/win_cor4.gif")" /></div>
		<div class="c2a"></div>
		<div class="c3"><img src="@StringTools.GetStaticFile("Images/Train/images/win_cor3.gif")" /></div>
	</div>*@
</div>
<!-- 预约成功 end -->
<span id="spanuname" style="display:none" >@ViewData["uname"].ToString()</span>
<div id="Mobile_str" style="display:none" ></div>
    <script src="@Url.Content("~/js/rasall.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/js/UTrain.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var have = $("[name=hidno]").val();
            var num = $("#hidallnum").val();
            if (have == "1") {
                $("#divisshow").hide();
            }
            else {
                if (num == "-1") {
                    $("#divissubmit").hide();
                }
            }
        });
    </script>

